import { createRouter, createWebHashHistory, RouteRecordRaw } from 'vue-router'
import { loadesFiles } from '@/uitls'
import { configName } from '@/config'
const config = configName()
const routes: RouteRecordRaw[] = [
  // 跟路由
  {
    path: '/',
    redirect: {
      name: config.HomeName
    },
    component: () => import('@/layout/main/mainLayout.vue'),
    children: loadesFiles(
      import.meta.glob('./routes/main/*.ts', { eager: true })
    )
  }
]

const router = createRouter({
  history: createWebHashHistory(),
  routes
})

export default router
